<?php
	session_name("treinamento_ejcm");
	session_start();
	function eq_seg_grau($a, $b, $c)
	{
		$delta = $b*$b - 4*$a*$c;
		if($delta == 0){
			return array(-$b / (2*$a), -$b / (2*$a));
		}
		else{
			$x1 = (-$b + sqrt($delta)) / (2*$a);
			$x2 = (-$b - sqrt($delta)) / (2*$a);
			return array($x1, $x2);
		}
	}
	
	$xs = eq_seg_grau($_GET['a'], $_GET['b'], $_GET['c']);
	$_SESSION['raiz1'] = $xs[0];
	$_SESSION['raiz2'] = $xs[1];
	header('Location: ./');
?>